package com.example.dynamicdatasource.config;

import com.example.dynamicdatasource.interceptor.ThreadLocalRemoveInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author mqb
 * @date 2021/8/9 20:03
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new ThreadLocalRemoveInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/static/**");
    }
}
